#ifndef __HVISITOR_H__
#define __HVISITOR_H__

#include "tree/ErrorNode.h"

#include "CACTLexer.h"
#include "CACTParser.h"
#include "CACTVisitor.h"

//using namespace antlr4;

extern int error_code;

class HAnalysis : public CACTVisitor {
public:
	std::any visitComp_unit(CACTParser::Comp_unitContext *context);

	std::any visitDecl(CACTParser::DeclContext *context);

	std::any visitConst_decl(CACTParser::Const_declContext *context);

	std::any visitB_type(CACTParser::B_typeContext *context);

	std::any visitConst_def(CACTParser::Const_defContext *context);

	std::any visitConst_init_val(CACTParser::Const_init_valContext *context);

	std::any visitVar_decl(CACTParser::Var_declContext *context);

	std::any visitVar_def(CACTParser::Var_defContext *context);

	std::any visitFunc_def(CACTParser::Func_defContext *context);

	std::any visitFunc_type(CACTParser::Func_typeContext *context);

	std::any visitFunc_params(CACTParser::Func_paramsContext *context);

	std::any visitFunc_param(CACTParser::Func_paramContext *context);

	std::any visitBlock(CACTParser::BlockContext *context);

	std::any visitBlock_item(CACTParser::Block_itemContext *context);

	std::any visitStmt(CACTParser::StmtContext *context);

	std::any visitExpr(CACTParser::ExprContext *context);

	std::any visitConst_expr(CACTParser::Const_exprContext *context);

	std::any visitLval(CACTParser::LvalContext *context);

	std::any visitPrimary_expr(CACTParser::Primary_exprContext *context);

	std::any visitNumber(CACTParser::NumberContext *context);

	std::any visitUnary_expr(CACTParser::Unary_exprContext *context);

	std::any visitFunc_args(CACTParser::Func_argsContext *context);

	std::any visitMul_expr(CACTParser::Mul_exprContext *context);

	std::any visitAdd_expr(CACTParser::Add_exprContext *context);

	std::any visitRel_expr(CACTParser::Rel_exprContext *context);

	std::any visitEq_expr(CACTParser::Eq_exprContext *context);

	std::any visitLg_and_expr(CACTParser::Lg_and_exprContext *context);

	std::any visitLg_or_expr(CACTParser::Lg_or_exprContext *context);

	std::any visitErrorNode(antlr4::tree::ErrorNode * node) override;
};

#endif